﻿var indexAlertPage;
$(function () {
    indexAlertPage = IndexAlertPageConstructor();
    indexAlertPage.initialize();
});

function IndexAlertPageConstructor() {

    this.SEARCH_TEXT_SELECTOR = "#tbName";
    this.SEARCH_BUTTON = $("#save");
   
    var _instance = new Object();
    var _this = this;

    this.searchTextKeyUp = function () {
        var text = $(_this.SEARCH_TEXT_SELECTOR).val();
        $.ajax(
        {
            type: "POST",
            url: "/TestAjax/MyTest",
            data: { value: text },
            success: function (result) {
            alert(result);
            }
        }
        );
    };

    _instance.initialize = function () {

        $(_this.SEARCH_BUTTON).click(_this.searchTextKeyUp);

    };
    
    return _instance;
};
